#ifndef HILANG_OS_HPP
#define HILANG_OS_HPP

#include "list.hpp"
#include "buffer.hpp"

#include <stdio.h>

void os_spawn_process(const char *exe, HiLangList<const char *> &args, bool detached);
void os_exec_process(const char *exe, HiLangList<const char *> &args,
        int *return_code, Buf *out_stderr, Buf *out_stdout);

void os_path_split(Buf *full_path, Buf *out_dirname, Buf *out_basename);
void os_path_join(Buf *dirname, Buf *basename, Buf *out_full_path);

void os_write_file(Buf *full_path, Buf *contents);


int os_fetch_file(FILE *file, Buf *out_contents);
int os_fetch_file_path(Buf *full_path, Buf *out_contents);

int os_get_cwd(Buf *out_cwd);

bool os_stderr_tty(void);

#endif

